package com.lk.mi.service.impl;

import com.lk.mi.entity.item;
import com.lk.mi.entity.shopCart;
import com.lk.mi.mapper.shopCartMapper;
import com.lk.mi.service.shopCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class shopCartServiceImpl implements shopCartService {

    @Autowired
    private shopCartMapper shopCartMapper;

    @Override
    public List<shopCart> findCart(Integer id) {
        List<shopCart> list =shopCartMapper.findCart(id);
        return list;
    }

    @Override
    public item addOne(Integer iid) {
        item item = shopCartMapper.addOne(iid);
        return item;
    }

    @Override
    public shopCart findByTwo(Integer uid, Integer iid) {
        shopCart shopCart = shopCartMapper.findByTwo(uid, iid);
        return shopCart;
    }

    @Override
    public Integer updateByUidAndIid(Integer uid, Integer iid) {
        Integer row = shopCartMapper.updateByUidAndIid(uid, iid);
        return row;
    }

    @Override
    public Integer updateByUidAndIid2(Integer uid, Integer iid) {
        Integer row = shopCartMapper.updateByUidAndIid2(uid, iid);
        return row;
    }


    @Override
    public Integer add(shopCart shopCart) {
        Integer row = shopCartMapper.add(shopCart);
        return row;
    }

    @Override
    public Integer delete(Integer id) {
        Integer row = shopCartMapper.delete(id);
        return row;
    }

    @Override
    public List<shopCart> findSbAllShopCart(Integer uid) {
        List<shopCart> list = shopCartMapper.findSbAllShopCart(uid);
        return list;
    }

    //TODO
}
